﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using aier.dataaccess.dapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace aier.dataaccess.dapper
{
    [TestClass()]
    public class ContactDalUT
    {
        private ContactDal contactDal = null;

        [TestInitialize]
        public void Init()
        {
            contactDal = new ContactDal();
            contactDal.dapperHelper = new DapperHelper();
        }

        [TestMethod()]
        public void QryContactUT()
        {
            var obj = contactDal.QryContact(new Guid("8C24E893-F5A2-E911-8113-A4B7FC79A232"));
            Console.WriteLine(obj.ToString());
        }

        [TestMethod()]
        public void QryContactListUT()
        {
            var obj = contactDal.QryContactList(new Guid("5DE0084D-89C2-E411-80B6-00155D94EE04"), 100000002, false, "2016-01-21", "2016-01-22", Guid.Empty);
            Console.WriteLine(obj.Count());
        }

        [TestMethod()]
        public void QryContactListByNameAndOwnerIdUT()
        {
            var obj = contactDal.QryContactListByNameAndOwnerId("a", new Guid("594B6908-DDA7-E411-80B6-00155D94EE04"));
            Console.WriteLine(obj.Count());
        }

        [TestMethod()]
        public void QryDistrictandcountyListUT()
        {
            var obj = contactDal.QryDistrictandcountyList( new Guid("594B6908-DDA7-E411-80B6-00155D94EE04"),1);
            Console.WriteLine(obj.Count());
        }
    }
}